package com.example.qqbotdemo.controller;

import com.example.qqbotdemo.listen.BotEventListen;
import jakarta.annotation.Resource;
import net.mamoe.mirai.Bot;
import org.springframework.boot.CommandLineRunner;
import org.springframework.boot.autoconfigure.SpringBootApplication;

@SpringBootApplication
public class BotStart implements CommandLineRunner {

    @Resource(name = "qqBot")
    private Bot bot;

    @Resource
    private BotEventListen botEventListen;

    @Override
    public void run(String... args) throws Exception {
        bot.login();
        bot.getEventChannel().registerListenerHost(botEventListen);
        System.out.println("INSTANCE registerListenerHost");

        bot.join();
    }
}
